#include "ProcessBar.h"
#define GREEN "\033[0;32;32m"
#define END "\033[m"
const char* lable = "|/-\\";
void processbar(int speed)
{
    char bar[NUM];
    memset(bar,'\0',sizeof(bar));
    int cnt = 0;
    while(cnt <= 100)
    {
        printf(GREEN"[%-100s][%d%%][%c]\r"END,bar,cnt,lable[cnt%4]);
        bar[cnt++] = STYLE;
        if(cnt < 100)
            bar[cnt] = '>';
        fflush(stdout);
        usleep(speed);
    }
    printf("\n");
}
